import {getAppInfo} from "@/api";

export function getUrlParams(url) {
    const urlObj = new URL(url);
    const params = {};
    for (const [key, value] of urlObj.searchParams.entries()) {
        params[key] = value;
    }
    return params;
}


export function redirectLogin() {
    getAppInfo().then(r => {
        let appInfo = r.data
        window.location.href = `${appInfo.authUrl}?client=${appInfo.appId}&redirect=${redirectUrl}`
    });
}
